﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AddMethod
{
	public abstract class A
	{
		public virtual int IQValue()
		{
			return 50;
		}

		public abstract void Run();
	}

	public interface IData
	{
		void Import(string data);
		string Export();
	}

	public class XmlData : IData
	{
		private string _data;
		public void Import(string data)
		{
			_data = data;
		}

		public string Export()
		{
			return string.Format("<element>{0}</element>", _data);
		}
	}

	public class JsonData : IData
	{
		private string _data;
		public void Import(string data)
		{
			_data = data;
		}

		public string Export()
		{
			return "{Element:"+_data + "}";
		}
	}

	public class A1 : A
	{
		public A1(int count)
		{
			_count = count;
		}
		private int _count;
		public int Count
		{
			get
			{
				return _count;
			}
			set
			{
				_count = value;
			}
		}

		public override int IQValue()
		{
			return 180;
		}

		public override void Run()
		{

		}

		public void Eat(ref string count)
		{

			Console.WriteLine("In Eat method i is {0}", count);
			count = count + "b";

		}
	}

	public class Food
	{

	}
}
